<template>
	<view class="follow-page">
		<view class="follow-items">
			<view
				class="follow-item"
				v-for="(follow, index) in followList"
				:key="index"
			>
				<view
					class="follow-avatar"
					@click="JUMP(follow)"
				>
					<u-avatar
						:src="follow.avatar"
						shape="square"
					></u-avatar>
				</view>
				<view class="follow-username">
					<span>{{ follow.username }}</span>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { getFollow } from '@/common/api/user.js';
export default {
	data() {
		return {
			src: 'http://rzh1in6w8.bkt.clouddn.com/uploads/src%3Dhttp___safe-img.xhscdn.com_bw1_84079a7f-0df5-485f-a81e-ced689065cc1_imageView2_2_w_1080_format_jpg%26refer%3Dhttp___safe-img.xhscdn.webp',
			followList: []
		};
	},
	methods: {
		getFollowList(id) {
			const that = this;
			getFollow(id).then((res) => {
				that.followList = res;
			});
		},
		JUMP(v) {
			const _id = v._id;
			const uid = v.uid;
			uni.navigateTo({
				url: `/pages/personCenter/personCenter?id=${_id}&uid=${uid}`
			});
		}
	},
	mounted() {},
	onLoad(options) {
		// console.log(options);
		this.getFollowList(options.id);
	}
};
</script>

<style lang="scss">
.follow-page {
	width: 750rpx;
	.follow-items {
		width: 100%;
		display: flex;
		align-items: center;
		flex-direction: column;
		.follow-item {
			width: 90%;
			height: 50px;
			display: flex;
			align-items: center;
			margin-top: 20rpx;
			border-bottom: 1px solid #eee;
			.follow-username {
				margin-left: 30rpx;
				font-family: 'Source Han Sans SC Bold';
			}
		}
	}
}
</style>
